local zishucup__lunqing = fk.CreateSkill{
  name = "zishucup__lunqing",
}

Fk:loadTranslationTable{
  ["zishucup__lunqing"] = "论情",
  [":zishucup__lunqing"] = "你可以将四张牌当【桃】使用，使用时若你没有手牌，你摸转化花色数张牌。",

  ["$zishucup__lunqing1"] = " ",
  ["$zishucup__lunqing2"] = " ",
}

zishucup__lunqing:addEffect("viewas", {
  anim_type = "support",
  pattern = "peach",
  card_filter = function(self, player, to_select, selected)
    return #selected < 4
  end,
  view_as = function(self, player, cards)
    if #cards ~= 4 then return end
    local c = Fk:cloneCard("peach")
    c.skillName = self.name
    c:addSubcards(cards)
    return c
  end,
  enabled_at_response = function (self, player, response)
    return not response
  end,
})

zishucup__lunqing:addEffect(fk.CardUsing, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return target == player and data.card.trueName == "peach" and data.card.skillName == zishucup__lunqing.name and player:isKongcheng()
    and #data.card.subcards == 4
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local suits = {}
    for _, id in ipairs(data.card.subcards) do
      table.insertIfNeed(suits, Fk:getCardById(id).suit)
    end
    player:drawCards(#suits, zishucup__lunqing.name)
  end,
})

return zishucup__lunqing
